from flask import Flask, request

# Flask实例
app = Flask(__name__)


@app.route("/sum", methods=['POST'])
def do_infer():

    # 获取输入字典
    req_json = request.get_json(force=True)
    xlist = req_json['list']

    xsum = 0
    for xel in xlist:
        xsum += xel

    xdict = {
        'sum': xsum
    }
    return xdict


if '__main__' == __name__:

    app.run('0.0.0.0', 7770)
